//
//  TeamSearchUserCell.swift
//  NETeamUIKit
//
//  Created by Laura on 2024/7/31.
//


import NIMSDK
import UIKit

@objcMembers
open class TeamSearchUserCell: NEBaseTeamSearchUserCell {
  override open func setupSubviews() {
    super.setupSubviews()
    NSLayoutConstraint.activate([
      headView.leftAnchor.constraint(
        equalTo: contentView.leftAnchor,
        constant: kScreenInterval
      ),
      headView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
      headView.widthAnchor.constraint(equalToConstant: 40),
      headView.heightAnchor.constraint(equalToConstant: 40),
    ])

    NSLayoutConstraint.activate([
      titleLabel.leftAnchor.constraint(equalTo: headView.rightAnchor, constant: 12),
      titleLabel.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -50),
      titleLabel.topAnchor.constraint(equalTo: headView.topAnchor),
      timeLabel.heightAnchor.constraint(equalToConstant: 22)
    ])

    NSLayoutConstraint.activate([
      subTitleLabel.leftAnchor.constraint(equalTo: headView.rightAnchor, constant: 12),
      subTitleLabel.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -50),
      subTitleLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 0),
      subTitleLabel.heightAnchor.constraint(equalToConstant: 18)
    ])

    NSLayoutConstraint.activate([
      bottomLine.rightAnchor.constraint(equalTo: contentView.rightAnchor),
      bottomLine.leftAnchor.constraint(equalTo: headView.leftAnchor),
      bottomLine.bottomAnchor.constraint(equalTo: bottomAnchor),
      bottomLine.heightAnchor.constraint(equalToConstant: 0.5),
    ])

    NSLayoutConstraint.activate([
      timeLabel.rightAnchor.constraint(
        equalTo: contentView.rightAnchor,
        constant: -kScreenInterval
      ),
      timeLabel.topAnchor.constraint(equalTo: headView.topAnchor),
    ])
  }

  override open func configData(message: V2NIMMessage, user: NECoreIM2Kit.NEUserWithFriend?) {
      super.configData(message: message, user: user)
  }
}

